package com.snjp.hywaytools;

import com.funever.bluetoochscanner.BluetoochUtils;
import com.funever.bluetoochscanner.ScannerResult;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

public class BlueScannerFragment extends Fragment implements OnClickListener{
	
	Button setting;
	
	TextView show;
	
	View contentView;
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		 contentView = inflater.inflate(R.layout.blue_scanner_layout, null);
		 return contentView;
	}
	
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		super.onActivityCreated(savedInstanceState);
		setting = (Button) contentView.findViewById(R.id.blue_setting); 
		show = (TextView) contentView.findViewById(R.id.scanvalue);
		setting.setOnClickListener(this);
	}

	public void disposeScanValue(String re) {
		show.setText(re);
	}

	@Override
	public void onClick(View v) {
		if(v == setting){
			MainActivity activity = (MainActivity) getActivity();
			BluetoochUtils utils = activity.utils;
			utils.showList();
		}
	}
}
